package com.taxi.driver.module.recruit.selectcity;

import android.support.v4.app.Fragment;

import com.qianxx.utils.SP;
import com.taxi.driver.R;
import com.taxi.driver.common.BasePresenter;
import com.taxi.driver.data.entity.ResourcesEntity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.inject.Inject;

/**
 * Created by Curry on 2018/5/15.
 */

public class SelectCityPresenter  extends BasePresenter implements SelectCityContract.Presenter
{
    private SelectCityContract.View mView;
    @Inject
    SP mSP;
    private List<ResourcesEntity> mCityList = new ArrayList<>();
    @Inject
    public SelectCityPresenter(SelectCityContract.View view) {
        mView = view;
    }

    @Override
    public void getAllCity()
    {
        List<ResourcesEntity> list = new ArrayList<>();
        List<String> cityStrings = Arrays.asList(((Fragment) mView).getResources().getStringArray(R.array.city_array));
        for (String item : cityStrings) {
            ResourcesEntity resources = new ResourcesEntity();
            resources.setName(item);
            list.add(resources);
        }
        mView.showAllCitys(list);
    }


    @Override
    public void subscribe() {

    }

    @Override
    public void unsubscribe() {
        super.unsubscribe();
    }
}
